package com.io;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;

public class FileUtilsTest {
    public static void main(String[] args) {
        try {
            FileUtils.writeStringToFile(new File("/Users/edy/Desktop/file1/1.txt"),new String("\n"),"UTF-8",true);
            FileUtils.writeStringToFile(new File("/Users/edy/Desktop/file1/1.txt"),new String("我爱你我爱你"),"UTF-8",true);
            FileUtils.copyDirectory(new File("/Users/edy/Desktop/file1"),new File("/Users/edy/Desktop/file2"));


            System.out.println(FileUtils.readLines(new File("/Users/edy/Desktop/file1/1.txt"), "UTF-8"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
